package cn.edu.ujn.service;

import cn.edu.ujn.dao.CarparkInfo;
import cn.edu.ujn.dao.CarparkInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CarparkInfoServiceImpl implements ICarparkInfoService{

    @Autowired
    private CarparkInfoMapper carparkInfoMapper;

    @Override
    public int deleteByPrimaryKey(Integer carparkid) {
        return carparkInfoMapper.deleteByPrimaryKey(carparkid);
    }

    @Override
    public int insert(CarparkInfo row) {
        return carparkInfoMapper.insert(row);
    }

    @Override
    public int insertSelective(CarparkInfo row) {
        return carparkInfoMapper.insertSelective(row);
    }

    @Override
    public CarparkInfo selectByPrimaryKey(Integer carparkid) {
        return carparkInfoMapper.selectByPrimaryKey(carparkid);
    }

    @Override
    public int updateByPrimaryKeySelective(CarparkInfo row) {
        return carparkInfoMapper.updateByPrimaryKeySelective(row);
    }

    @Override
    public int updateByPrimaryKey(CarparkInfo row) {
        return carparkInfoMapper.updateByPrimaryKey(row);
    }

    @Override
    public List<CarparkInfo> selectAll(CarparkInfo carpark) {
        return carparkInfoMapper.selectAll(carpark);
    }

    @Override
    public List<Integer> selectPrimaryKeys() {
        ArrayList<Integer> list = new ArrayList<Integer>();

        for (CarparkInfo selectPrimaryKey : carparkInfoMapper.selectPrimaryKeys()) {
            Integer carparkid = selectPrimaryKey.getCarparkid();
            list.add(carparkid);
        }
        return list;
    }
}
